#pragma once

#include <thrust/sequence.h>

template <typename Container>
struct Sequence
{
  Container A;

  template <typename Range>
  Sequence(const Range& X)
    : A(X.begin(), X.end())
  {}

  void operator()(void)
  {
    thrust::sequence(A.begin(), A.end());
  }
  
  void reset(void)
  {
    // nothing to do
  }
};

template <typename Container,
          typename T>
struct SequenceInit
{
  Container A;
  T init;

  template <typename Range>
  SequenceInit(const Range& X, T init)
    : A(X.begin(), X.end()),
      init(init)
  {}

  void operator()(void)
  {
    thrust::sequence(A.begin(), A.end(), init);
  }
  
  void reset(void)
  {
    // nothing to do
  }
};

template <typename Container,
          typename T>
struct SequenceInitStep
{
  Container A;
  T init;
  T step;

  template <typename Range>
  SequenceInitStep(const Range& X, T init, T step)
    : A(X.begin(), X.end()),
      init(init),
      step(step)
  {}

  void operator()(void)
  {
    thrust::sequence(A.begin(), A.end());
  }
  
  void reset(void)
  {
    // nothing to do
  }
};

